<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<html>
<head>
	<meta charset="utf-8" />
	<title>厅干部平时考核管理系统</title>
	<script type="text/javascript" src="<c:url value='/resource/jxkh/js/views/wdyb.js'/>"></script>
	</head>

	<body>
	<input type="hidden" id="type" value="${type }"/>
		<div class="njga" style="overflow: auto;">
						<div class="bmkhcp" style="padding: 1px;">
							<div class="bmkhcp_lf" style="width: 100%;">
								<div class="title" >
									<c:if test="${type=='1'}">我的月小结</c:if>
									<c:if test="${type=='2'}">我的季度小结</c:if>
									</div>
							<div class="khzpzp_row khzpzp_row1" style="height: 40px;margin-top:8px;">
								<div class="p_text"  style="width: 80px;">开始时间</div>
								<div class="zp_select">
									<input type="text" placeholder="请选择日期" id="dateinfo" name="months" class="inpt1"  />
									<div class="arrow_down"></div>
								</div>
								<div class="p_text" style="width: 80px;">结束时间</div>
								<div class="zp_select">
									<input type="text" placeholder="请选择日期" id="dateinfo1" name="months" class="inpt1"  />
									<div class="arrow_down"></div>
								</div>
								<button class="btn btn1" onclick="search0bj()">查询</button>
								<%--<c:if test="${result==false}"> --%>
									<div class="xzzb_add" onclick="addYdxj(-1)"><span>+</span>
									<c:if test="${type=='1'}">新增月小结</c:if>
									<c:if test="${type=='2'}">新增季度小结</c:if>
									</div>
								<%--</c:if>--%>
							</div>
								<table id="boot_table"  >
								</table>

						</div>
						</div>

						</div>

		<script type="text/javascript">
			var index1 =2;
			var index2 =2;
			var index3 =2;
			 $(document).ready(function(){
				 initTable();
				 jeDate({
				 dateCell: "#dateinfo1",
					 format: "YYYY-MM-DD",
					 choosefun:function(val) {
						 //alert(111);
					 }

				 });
				 jeDate({
					 dateCell: "#dateinfo",
					 format: "YYYY-MM-DD",
					 choosefun:function(val) {
						 //alert(111);
					 }
				 });
				 $(".td_select_xl").slideUp(200);
				 $(".text_rt").click(function(e) {
					 e = e || window.event;
					 if(e.stopPropagation) {
						 e.stopPropagation();
					 } else {
						 e.cancelBubble = true;
					 }
					 $(this).children(".td_select_xl").slideToggle(200);
					 $(this).parents(".row_pop_new").siblings(".row_pop_new").find(".td_select_xl").slideUp(200);
					 var selecttext = $(this).children("p");
					 var selectmain = $(this).children(".td_select_xl");
					 var lis = selectmain.find('li');
					 for(var i = 0; i < lis.length; i++) {
						 lis[i].onclick = function() {
							 selectmain.hide();
							 var textval = $(this).html();
							 selecttext.text(decodeURIComponent(textval));
						 }
					 }
				 });
				 $(".td_select_xl li").click(function(e) {
					 e = e || window.event;
					 if(e.stopPropagation) {
						 e.stopPropagation();
					 } else {
						 e.cancelBubble = true;
					 }
					 $(".td_select_xl").slideUp(200);
				 });
				//自我评价
				$(".ldpj_table_td .inpt_w_l").click(function(){
					$(this).addClass("inpt_w_l_hov");
					$(this).parent(".inpt_w").siblings(".inpt_w").children(".inpt_w_l").removeClass("inpt_w_l_hov");
				});
				//考勤情况
				$(document).click(function() {
				$(".td_select_xl").slideUp(200);
			});
			$(".td_select1").click(function(e) {
				e = e || window.event;
				if(e.stopPropagation) {
					e.stopPropagation();
				} else {
					e.cancelBubble = true;
				}
				$(this).next(".td_select_xl").slideToggle(200);
				$(this).parents("tr").siblings("tr").find(".td_select_xl").hide();
				var selecttext = $(this).children("p");
				var selectmain = $(this).next(".td_select_xl");
				var lis = selectmain.find('li');
				for(var i = 0; i < lis.length; i++) {
					lis[i].onclick = function() {
						selectmain.hide();
						var textval = $(this).html();
						selecttext.text(decodeURIComponent(textval));
					}
				}
			});

    });

			function addYdxj(dbid){
				var title ="我的月小结";
				if("${type}"=="1"){
					title ="我的月小结";
				} else if("${type}"=="2"){
					title ="我的季度小结";
				}
				var url = "<c:url value='/worklog/editWdyb/@.html'/>".replace("@",dbid)+"?type="+"${type}" ;
				var open =  layer.open({
					type: 2,//0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
					shift: 1,//动画    0-6     css3动画
					closeBtn: 1,//关闭按钮  0 不显示  style  1和2  标题为 false 2
					btn: ['保存', '取消'],
					btn1: function(index, layero){
						var newpsw = $(layero).find("iframe")[0].contentWindow;
						newpsw.submitForm();
					},
					title:[title,'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
					area: ['1100px', '640px'], //宽高
					content:url //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
				});
			}
			function search0bj(){
				$('#boot_table').bootstrapTable('refresh', {url:"<c:url value='/worklog/wdyblist.json?start='/>"+$("#dateinfo").val()+"&end="+$("#dateinfo1").val()});
			}
		</script>
	</body>

</html>